package com.yoso.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.stereotype.Component;

import javax.validation.constraints.Max;
import javax.validation.constraints.Past;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.Date;

/**
 * @author shizejin
 * @date 2021/10/26
 * @description:
 */
@Data
@Component
public class User implements Serializable {
    private String id;
    @Size(min = 1,max = 5,message = "名字长度在{min}到{max}之间")
    private String name;
    @Max(value = 5,message = "年龄最大为5")
    private int age;
    private String addr;
    @JsonFormat(pattern = "yyyyMMdd",timezone = "GMT+8")
    @Past
    private Date birthday;
    private SecInfo secInfo;

    @Override
    protected void finalize() throws Throwable {

        // TODO Auto-generated method stub
        System.out.println("调用finalize");

        super.finalize();
    }
}
